This page last changed on Jun 22, 2006 by aperepel.

The FTP connector allows files to be read and written to and from remote Ftp servers.
The javadoc for this transport provider can be found here. And the Source Xref can be found here.

Ftp Connector Properties

Property Description Default Required
pollingFrequency The frequency in milliseconds that the read directory should be checked. Not the read directory is specified by the endpoint of the listening component. 1000 Yes
filenameParser Is an implementation of org.mule.providers.file.FilenameParser and is used to control how filename patterns are used to generate file names. The file provider has a default implementation called org.mule.providers.file.SimpleFilenameParser that understands the following patterns:
  • ${DATE} - the current date in the format dd-MM-yy_HH-mm-ss.SS
  • ${DATE:yy-MM-dd} - the current date using the specified format
  • ${SYSTIME} - The current system time milliseconds
  • ${UUID} - A generated Universally unique id
  • ${ORIGINALNAME} - The original file name if the file being written was read from another location
  • ${COUNT} - An incremental counter
org.mule.providers.file. SimpleFilenameParser Yes
outputPattern The pattern to use when writing a file to disk. This can use the patterns supported by the filenameParser configured for this connector ${DATE} (If default is used) Yes
passive Whether to use FTP passive mode (allows to go through firewalls) true No
binary  Whether to use BINARY or ASCII file types for transfer true  No 
validateConnections  Whether to validate FTP connections before use.  This takes care of a failed (or restarted) FTP server at the expense of an additional NOOP command packet being sent, but increases overall availability.
true No 

Ftp Endpoints

Ftp endpoints are expressed using standard Ftp URI syntax -

ftp://<username>:<password>@<hostname[:port]>/[address]

for example -

ftp://joe:[email protected]/~

This will connect to the ftp server at mycompany.com logging in a ser user joe with password 123456 and will work on joe's home directory.

Filename Filters

Filters can be set on the endpoint to control what files are received by the endpoint. The filters are expressed in a comma-separated list. To set up a filter to only read .xml and .txt files the following can be used.

<endpoint address="ftp://joe:[email protected]/ftp/incoming">
    <filter pattern="*.txt,*.xml"
         className="org.mule.providers.file.filters.FilenameWildcardFilter"/>
</endpoint>

Property Overrides

You can override certain properties when defining a Ftp endpoints to control the way that endpoint is configured. These properties can be set on the endpoint or the current event.

Property Description
filename When dispatching events using an Ftp endpoint the filename property can be used to set the outbound filename.
outputPattern This can be set to an output file pattern using the variables supported on the FilenameParser for this connector (see Connector Properties). If the filename property is set, this will be ignored.
pollingFrequency Controls the polling frequency of the inbound endpoint. This can only be set on the endpoint and will be ignored if set on the event.
passive FTP passive mode is honored on an endpoint level as well.
binary  BINARY / ASCII file type.

For example, to set the output pattern -

<endpoint address="ftp://joe:[email protected]/ftp/done">
    <properties>
        <property name="outputPattern" value="FtpFile-${DATE}.done"/>
    </properties>
</endpoint>

Or to specify the same Endpoint using an URI -

ftp://joe:[email protected]/ftp/done?outputPattern=FtpFile-${DATE}.done

For more information about configuring Endpoint go here.

Document generated by Confluence on Nov 27, 2006 10:27